// 搜索配置
export const searchOption = ref({
  formConfig: {
    tenantId: {
      label: "客户ID",
    },
    customerName: {
      label: "客户名称",
    },
    operationModeId: {
      label: "运营模式",
      component: "el-select",
      dicUrl: "",
      options: [],
    },
    updateName: {
      label: "操作人员",
    },
    // 开通时间
    createTime: {
      label: "开通时间",
      component: "el-date-picker",
      type: "daterange",
    },
    // 到期时间
    expiredTime: {
      label: "到期时间",
      component: "el-date-picker",
      type: "daterange",
    },
  },
  menu: true,
});

// 表格配置
export const tableOption = ref(
  Utils.tools.deleteSearchConfig({
    menuHeaderAlign: "center",
    // 弹窗宽度
    dialogWidth: "30%",
    menu: true,
    height: 600,
    // 是否显示编辑按钮
    editBtn: false,
    // 是否显示删除按钮
    delBtn: false,
    // 菜单宽度 单个按钮 52px 按钮容器内边距 8px 例如：4个按钮 = 52 * 4 * 8
    menuWidth: 216,
    // 表格配置
    column: {
      //时间
      createTime: {
        label: "时间",
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      //类型
      type: {
        label: "类型",
      },
      //金额
      amount: {
        label: "变更金额",
      },
      //操作人员
      updateName: {
        label: "变更人",
      },
    },
  })
);
export const getColumn = (type = "01") => {
  if (type === "01") {
    const column = {
      //时间
      createTime: {
        label: "时间",
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      //类型
      type: {
        label: "类型",
      },
      //金额
      amount: {
        label: "变更金额",
      },
      //操作人员
      updateName: {
        label: "变更人",
      },
    };
    tableOption.value.column = column;
    return false;
  }
  if (type === "02") {
    const column = {
      //编号
      id: {
        label: "编号",
      },
      //采购流水
      purchaseSerial: {
        label: "采购流水",
      },
      //采购单号
      purchaseSerialNumber: {
        label: "采购单号",
      },
      //关联订单编号
      orderSerialNumber: {
        label: "关联订单编号",
      },
      //支付时间
      payTime: {
        label: "支付时间",
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      //变动金额
      amount: {
        label: "变动金额",
      },
      //交易类型
      tradeType: {
        label: "交易类型",
      },
    };
    tableOption.value.column = column;
    tableOption.value.menu = false;
    return false;
  }
  if (type === "03") {
    const column = {
      //编号
      id: {
        label: "编号",
      },
      //订单号
      orderSerialNumber: {
        label: "订单编号",
      },
      //保单号
      policySerialNumber: {
        label: "保单编号",
      },
      //投保流水编号
      purchaseSerialNumber: {
        label: "投保流水编号",
      },
      //投保费
      purchaseFee: {
        label: "投保费（元）",
      },
      //投保时间
      purchaseTime: {
        label: "投保时间",
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      //理赔流水编号
      claimSerialNumber: {
        label: "理赔流水编号",
      },
      //理赔费
      claimFee: {
        label: "理赔费（元）",
      },
      //理赔成功时间
      claimSuccessTime: {
        label: "理赔成功时间",
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      //退保流水编号
      withdrawSerialNumber: {
        label: "退保流水编号",
      },
    };
    tableOption.value.column = column;
    tableOption.value.menu = false;
    return false;
  }
  if (type === "04") {
    const column = {
      //编号
      $index: {
        label: "编号",
      },
      //充值订单编号
      orderSerialNumber: {
        label: "充值订单编号",
      },
      //充值账户
      rechargeAccount: {
        label: "充值账户",
      },
      //充值金额
      rechargeAmount: {
        label: "充值金额",
      },
      //收款方
      payee: {
        label: "收款方",
      },

      //充值日期
      rechargeTime: {
        label: "充值日期",
        type: "datetime",
        format: "YYYY-MM-DD",
      },
      //充值状态
      rechargeStatus: {
        label: "充值状态",
      },
    };
    tableOption.value.column = column;
    tableOption.value.menu = false;
    return false;
  }
  if (type === "05") {
    const column = {
      //编号
      $index: {
        label: "编号",
      },
      //转账单号
      transferSerialNumber: {
        label: "转账单号",
      },
      //转账账户
      transferAccount: {
        label: "转账账户",
      },
      //转账金额
      transferAmount: {
        label: "转账金额",
      },
      //转账日期
      transferTime: {
        label: "转账日期",
        type: "datetime",
        format: "YYYY-MM-DD",
      },
      //审核状态
      transferStatus: {
        label: "审核状态",
      },
      //转账方名称
      transferName: {
        label: "转账方名称",
      },
      //转账方银行名称
      transferBankName: {
        label: "转账方银行名称",
      },
      //转账凭证
      transferVoucher: {
        label: "转账凭证",
      },
      //发起人
      transferFromName: {
        label: "发起人",
      },
      //发起时间
      transferFromTime: {
        label: "发起时间",
        type: "datetime",
        format: "YYYY-MM-DD",
      },
      //审核人
      transferCheckName: {
        label: "审核人",
      },
    };
    tableOption.value.menuWidth = 300;
    tableOption.value.column = column;
    tableOption.value.menu = true;
    return false;
  }
  if (type === "06") {
    const column = {
      //提现单号
      withdrawSerialNumber: {
        label: "提现单号",
      },
      //提现账户
      withdrawAccount: {
        label: "提现账户",
      },
      //申请人
      withdrawName: {
        label: "申请人",
      },
      //提现金额
      withdrawAmount: {
        label: "提现金额(元)",
      },
      //提现服务费
      withdrawServiceFee: {
        label: "提现服务费(元)",
      },
      //申请时间
      withdrawTime: {
        label: "申请时间",
        type: "datetime",
        format: "YYYY-MM-DD",
      },
      //审核状态
      withdrawStatus: {
        label: "审核状态",
      },
      //备注
      withdrawRemark: {
        label: "备注",
      },
      //打印凭证
      withdrawPrintVoucher: {
        label: "打印凭证",
      },
    };
    tableOption.value.column = column;
    tableOption.value.menu = false;
    return false;
  }
  if (type === "07") {
    const column = {
      //编号
      $index: {
        label: "编号",
      },
      //订单号
      orderSerialNumber: {
        label: "订单号",
      },
      //总租金
      totalRent: {
        label: "总租金",
      },
      //租期
      rent: {
        label: "租期",
      },
      //期数
      rentNumber: {
        label: "期数",
      },
      //付租日
      rentDate: {
        label: "付租日",
        type: "datetime",
        format: "YYYY-MM-DD",
      },
      //当期租金
      rentMoney: {
        label: "当期租金",
      },
      //实付时间
      rentTime: {
        label: "实付时间",
        type: "datetime",
        format: "YYYY-MM-DD",
      },
      //平台分期
      rentStage: {
        label: "平台分期",
      },
      //实际收入
      rentIncome: {
        label: "实际收入",
      },
      //支付状态
      rentPayStatus: {
        label: "支付状态",
      },
      //备注
      rentRemark: {
        label: "备注",
      },
    };
    tableOption.value.column = column;
    tableOption.value.menu = true;
    tableOption.value.menuWidth = 200;
    return false;
  }
  if (type === "08") {
    const column = {
      //编号
      $index: {
        label: "编号",
      },
      //订单号
      orderSerialNumber: {
        label: "订单号",
      },
      //总租金
      totalRent: {
        label: "总租金",
      },
      //租期
      rent: {
        label: "租期",
      },
    };
  }
};

export const appTableOption = ref(
  Utils.tools.deleteSearchConfig({
    height: 300,
    menu: false,
    // 弹窗宽度
    dialogWidth: "30%",
    // 是否显示编辑按钮
    editBtn: false,
    // 是否显示删除按钮
    delBtn: false,
    // 菜单宽度 单个按钮 52px 按钮容器内边距 8px 例如：4个按钮 = 52 * 4 * 8
    menuWidth: 216,
    // 表格配置
    column: {
      serviceName: {
        label: "应用名称",
        width: 120,
      },

      serviceTypeName: {
        label: "应用类型",
        width: 320,
      },

      // operationModeName: {
      //   label: "运营模式",
      //   width: 120,
      // },

      tenantCost: {
        label: "成本",
        minWidth: 120,
      },

      tenantFee: {
        label: "资费",
        minWidth: 120,
      },
    },
  })
);
export const renewTableOption = ref(
  Utils.tools.deleteSearchConfig({
    height: 300,
    menu: false,
    // 是否显示编辑按钮
    editBtn: false,
    // 是否显示删除按钮
    delBtn: false,
    // 菜单宽度 单个按钮 52px 按钮容器内边距 8px 例如：4个按钮 = 52 * 4 * 8
    menuWidth: 216,
    // 表格配置
    column: {
      createTime: {
        label: "续费时间",
        width: 180,
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      renewalAmount: {
        label: "续费金额",
      },
      expireDate: {
        label: "到期时间",
        width: 180,
        type: "datetime",
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
      },
      updateName: {
        label: "操作人员",
      },
      // renewalPeriod: {
      //   label: "续费年限",
      // },
    },
  })
);

export const tabOptions = ref([
  {
    label: "消费服务列表",
    name: "01",
  },
  {
    label: "采购记录",
    name: "02",
  },
  {
    label: "蚂蚁保",
    name: "03",
  },
  //充值记录
  {
    label: "充值记录",
    name: "04",
  },
  //线下转账记录
  {
    label: "线下转账记录",
    name: "05",
  },
  //提现列表
  {
    label: "提现列表",
    name: "06",
  },
  //租金列表
  {
    label: "租金列表",
    name: "07",
  },
  // //买断金
  // {
  //     label: "买断金",
  //     name: "08",
  // },
  // //增值服务
  // {
  //     label: "增值服务",
  //     name: "09",
  // },
]);
